
layui.use(['form', 'laydate', 'util','layer'], function(){
    var layer=layui.layer;
    var $=layui.$;
    var form=layui.form;
    $.ajax({
        url:'/custom',
        method:'get',
        data:{
            action:'selectAll',
        },
        dataType: 'json',
        success:function (data){
            let cusAll=data.data.map((item)=>{
                return`
                <option value="${item.name}">${item.name}</option>
                `
            }).join('')
            $("#relationCus").html(cusAll)
            form.render('select')
        }
    })
    form.on('submit(demo1)',function (obj){
        $.ajax({
            url:"buyChance?action=addBuyChance",
            data:obj.field,
            method:'POST',
            dataType:'json',
            success:function (data){

            }
        })
    })
})